<extend name="Index/index"/>

<block name="content">
    <!--<div class="view-product" style="margin-top: 50px">-->
    <div class="info-center">
        <div class="manage-head">
            <h6 class="padding-left manage-head-con">{{$title}}</h6>
        </div>

        <div class="layui-container" style="margin-top: 20px">
            <div class="layui-row">
                <!--<div class="demoTable">-->
                <!--<a href="{{$prev}}" class="layui-btn layui-btn-normal">返回上一页</a>-->
                <!--</div>-->
                <div>
                    <form class="layui-form" action="{{:U('User/saveUserPower')}}" method="post">
                        <!--模块列表-->
                        <foreach name="moduleList" item="value">
                            <div class="layui-form-item">
                                <label class="layui-form-label">{{$value.module}}</label>

                                <!--权限列表-->
                                <foreach name="powerList" item="val">
                                    <eq name="val.module_id" value="$value['id']">
                                        <div class="layui-input-inline">
                                            <input type="checkbox" name="{{$val.id}}" value="{{$val.id}}"
                                                   title="{{$val.action}}" lay-skin="primary" {{:in_array($val['id'],$power)
                                            ? "checked" : "" }}>
                                        </div>
                                    </eq>
                                </foreach>
                            </div>

                        </foreach>


                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit>立即提交</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </form>

                </div>
            </div>
        </div>
        <script>
            var ue = UE.getEditor('editor', {  //intro_detail为要编辑的textarea的id
                initialFrameWidth: 1000,  //初始化宽度
                initialFrameHeight: 300,  //初始化高度
            });
            ue.ready(function () {
                ue.setHeight(300);
            });

            // Demo
            layui.use('form', function () {
                var form = layui.form;

                //监听提交
                form.on('submit(formDemo)', function (data) {
                    layer.msg(JSON.stringify(data.field));
                    return false;
                });
            });
            layui.use('laydate', function () {
                var laydate = layui.laydate;
                //日期时间选择器
                laydate.render({
                    elem: '#test1'
                    , type: 'month'
                });
                laydate.render({
                    elem: '#test2'
                    , type: 'month'

                });
                laydate.render({
                    elem: '#test3'
                });
                laydate.render({
                    elem: '#test4'

                });
            });
        </script>

    </div>
    <!--</div>-->

</block>